package com.briup;


import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.InputStream;
import java.util.Map;

public class GetStuReturnStuAndClass {

  public static void main(String[] args) {
      String resource = "mybatis-config.xml";
      SqlSession sqlSession = null;
      try (InputStream resourceAsStream = Resources.getResourceAsStream(resource)) {
          SqlSessionFactory build = new SqlSessionFactoryBuilder().build(resourceAsStream);
          sqlSession = build.openSession(true);
          StuMapper mapper = sqlSession.getMapper(StuMapper.class);
          Student student = mapper.GetStuReturnStuAndClazz(3);
          System.out.println(student);

      }catch (Exception e){
          e.printStackTrace();
      }
      
  }
}
